package com.hbt.yiqing.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

import androidx.annotation.Nullable;

public class UserTable extends SQLiteOpenHelper implements BaseColumns {
    public static final String TABLE_NAME = "users";
    public static final String USERNAME = "username";
    public static final String PASSWORD = "password";
    public static final String INFO = "info";
    public static final String ALLOW = "allow";
    public UserTable(@Nullable Context context) {
        super(context,"user.db", null, 1 );
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table "+TABLE_NAME+"( _id INTEGER PRIMARY KEY AUTOINCREMENT, "
                +USERNAME+" TEXT ,"
                +PASSWORD+" TEXT ,"
                +INFO+" TEXT,"+ALLOW+" TEXT )";
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
